/* static/css/style.css */
/* 公交智能调度系统 - 核心样式 */
/* 修复 "未解析的模板引用 'css/style.css'" 错误 */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-light: #e2e8f0;
    --card-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

/* ========== 全局重置与基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ========== 导航栏样式 ========== */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.8rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    font-size: 1.5rem;
    margin-right: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
}

.nav-link i {
    margin-right: 5px;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    background-color: white;
    border-right: 1px solid var(--gray-light);
    min-height: calc(100vh - 56px);
    padding: 1.5rem 0;
    box-shadow: var(--card-shadow);
}

.sidebar .nav-item {
    margin-bottom: 0.5rem;
}

.sidebar .nav-link {
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    font-weight: 500;
    border-radius: 0;
}

.sidebar .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

/* ========== 主内容区样式 ========== */
.main-content {
    padding: 2rem;
    background-color: #f1f5f9;
    min-height: calc(100vh - 56px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.page-header h2 i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.5rem;
}

/* ========== 卡片样式 ========== */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.card-header {
    padding: 1rem 1.5rem;
    background-color: white;
    border-bottom: 1px solid var(--gray-light);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3, .card-header h4 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.card-header i {
    margin-right: 10px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.card-body {
    padding: 1.5rem;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #152c6e;
    border-color: #152c6e;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #0da271;
    border-color: #0da271;
}

.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========== 表格样式 ========== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 1rem;
    text-align: left;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-light);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(59, 130, 246, 0.05);
}

.table-hover tbody tr:hover {
    background-color: #f0f7ff;
}

.table-hover tbody tr:hover td {
    border-bottom-color: #c7d8ff;
}

/* ========== 徽章样式 ========== */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 1em;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

.badge i {
    margin-right: 5px;
    font-size: 0.8rem;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* ========== 表单样式 ========== */
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.form-text {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ========== 指标卡片样式 ========== */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    color: white;
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card h5 {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
    font-size: 1.1rem;
}

.stats-card h5 i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.stats-card h1 {
    font-size: 2.5rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.stats-card.bg-primary { background: linear-gradient(to right, #3b82f6, #2563eb); }
.stats-card.bg-success { background: linear-gradient(to right, #10b981, #059669); }
.stats-card.bg-info { background: linear-gradient(to right, #0ea5e9, #0284c7); }
.stats-card.bg-warning { background: linear-gradient(to right, #f59e0b, #d97706); }

/* ========== 告警区域样式 ========== */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: none;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* ========== 页脚样式 ========== */
.footer {
    margin-top: auto;
    background-color: white;
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    text-align: center;
    color: #64748b;
}

/* ========== 响应式设计 ========== */
@media (max-width: 992px) {
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--gray-light);
    }

    .navbar-collapse {
        margin-top: 1rem;
    }

    .stats-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .table td, .table th {
        padding: 0.75rem;
    }

    .btn i {
        margin-right: 5px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header .btn {
        margin-top: 1rem;
        width: 100%;
    }
}